﻿using System;
using System.Collections.Generic;
using System.Text;
using Com.AlbLab.GEP.Dao.Base;
using Com.AlbLab.GEP.Dao.Interface;
using Com.AlbLab.GEP.Dao.Impl;

namespace Com.AlbLab.GEP.Services.Base
{
    public class BaseSingleton<T> where T : class, new()
    {
        private IDaoBaseSession<ISessionModel> dbProvider;

        protected IDaoBaseSession<ISessionModel> DbProvider
        {
            get { return dbProvider; }
        }


        public IDaoBaseSession<ISessionModel> DbProviderSetter
        {
            set { if (dbProvider == null) dbProvider = value; }
        }

        static readonly T instance = new T();
        
        static BaseSingleton()
        {
        }

       
        protected BaseSingleton()
        {

        }

        public static T Instance
        {
            get { return instance; }
        }

       
    }
}
